import Ice.Current;
import Ice.Object;
import PositionServer._PositionServiceDisp;
import PositionServer.Coordinate;

public class PositionServer extends Ice.Application {

	class PositionServiceI extends _PositionServiceDisp
	{

		@Override
		public void reportPosition(Coordinate position, long time,
				String strategyName, String configValue, Current __current) 
		{
			System.out.println("PositionService called by " + strategyName);	
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		PositionServer s = new PositionServer();
		int status = s.main("Server", args);
		System.exit(status);
	}

	@Override
	public int run(String[] arg0) {
		Ice.ObjectAdapter adapter = communicator().createObjectAdapterWithEndpoints("PositionServer", "tcp -h 127.0.0.1 -p 11000");
		adapter.add((Object) new PositionServiceI(), communicator().stringToIdentity("position"));
		adapter.activate();
		communicator().waitForShutdown();
		return 0;
	}

}
